package com.zhu.mapper.impl;

import com.zhu.mapper.MySqlSessionSupport;
import com.zhu.mapper.UserNameDAO;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by DELL on 2015/12/24.
 */
@Repository("userNameDAOWithSupport")
public class UserNameDAOWithSupportImpl implements UserNameDAO {

    @Autowired
    private MySqlSessionSupport sqlSessionSupport;

    @Override
    public String getUserName(long id) {
        return sqlSessionSupport.getSqlSession().selectOne("com.zhu.myMapper.User.selectNameById", id);
    }
}
